﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SundayWishModel.Entities;
using SundayWishBLL;
public partial class register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        UserInfo ui = new UserInfo();
        UserHelper uh = new UserHelper();
        ui.UserName = tbUserName.Text;
        ui.UserPassword = tbPassword.Text;
        ui.RegisterTime = DateTime.Today;
        ui.LastLogin = DateTime.Today;
        ui.LastLogout = DateTime.Today;
        ui.PhoneNumber = tbPhone.Text;
        ui.UserGender = RadioButton2.Checked ? 0 : 1;
        if (uh.AddUser(ui))
        {
            result.Visible = false;
            tt.Visible = true;
            lbuser.Text = ui.UserName;
        }
        else
        {
            result.Visible = true;
            result.InnerText = "用户名已存在";
        }
    }
}
